<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <canvas id="c" width="400" height="400" style="border: 1px solid #ccc"></canvas>

        <script>
            const context = document.getElementById('c')
            const ctx = context.getContext('2d')

            const lgrd = ctx.createLinearGradient(10, 10, 200, 10)
            lgrd.addColorStop(0, 'pink')
            lgrd.addColorStop(1, 'yellow')
            ctx.strokeStyle =lgrd
            lineWidth = 10
            ctx.strokeRect(10, 10, 200, 200)
        </script>
    </body>
</html>
